// 项目入口文件
var http = require('http');
var config = require('./config.js');
var render = require('./common/render.js');
var router =require('./router.js');

// var path = require('path');
var server = http.createServer();
// 客服端请求服务器时,出发requst请求
server.on('request', function(req, res) {
    // res.end('<h1>相关node已开启</h1>');
    render(res);
    router(req,res);
});
server.listen(config.port, config.host, function() {
	console.log('聊天端口开启' + '地址:' + config.host + '端口：' + config.port);
});